<!-- #layout name=blank --sideType='market'-->
<div class="page-header">
    <h1 class="title">My proposals</h1>
</div>
<div data-bind="component: { name: 'kb-breadcrumb', params:[{
    name: 'MARKET'
},{
    name: Kooboo.text.common.Demands,
    url: Kooboo.Route.Demand.ListPage
},{
    name: Kooboo.text.market.demand.myProposals
}]}"></div>

<ul class="nav nav-tabs" data-bind="foreach: { data: proposalTypes, as: 'type' }">
    <li data-bind="css: { active: $parent.curType() == type.value }, click: $parent.changeTab.bind(this, $data)">
        <a href="javascript:;" data-toggle="tab" data-bind="text: type.displayName"></a>
    </li>
</ul>
<table class="table table-hover table-striped">
    <thead>
        <tr>
            <th>Demand</th>
            <th class="table-short">Budget</th>
            <th class="table-short">Duration</th>
            <th class="table-short">Created at</th>

            <!-- ko if: curType() == 'inTheBid' -->

            <!-- /ko -->
        </tr>
    </thead>
    <tbody data-bind="foreach: records">
        <tr>
            <td class="summary">
                <a href="javascript:;" data-bind="attr: { href: $data.previewUrl()}" target="_blank">
                    <p class="title" data-bind="text: $data.title"></p>
                    <p data-bind="text: $data.description"></p>
                </a>
            </td>
            <td><span class="label label-sm label-info" data-bind="text: $data.budget, tooltip: $data.currency"></span></td>
            <td data-bind="text: $data.duration"></td>
            <td data-bind="text: $data.createTime"></td>
            <!--    <td>
                <a class="btn btn-xs btn-default" data-bind="attr: { href: $data.previewUrl()}" target="_blank">
                    <i class="fa fa-eye"></i>
                </a>
            </td>-->
            <!-- ko if: $parent.curType() == 'inTheBid' -->
            <!--    <td>
                <button class="btn btn-xs btn-info" data-bind="click: $parent.onUpdateProposal.bind(this, $data)">
                            <i class="fa fa-pencil"></i>
                        </button>
            </td>
            <td>
                <button class="btn btn-xs red" data-bind="click: $parent.onDeleteProposal.bind(this, $data)">
                            <i class="fa fa-trash"></i>
                        </button>
            </td>-->
            <!-- /ko -->
        </tr>
    </tbody>
</table>
<div data-bind="component: { name: 'kb-pager', params: pager }"></div>
<proposal-modal params="isShow: showProposalModal, data: showingProposal, mode: proposalViewingMode"></proposal-modal>

<script>
    (function() {
        Kooboo.loadJS([
            "/_Admin/Scripts/components/kbBreadcrumb.js",
            "/_Admin/View/Market/Scripts/components/ProposalModal.js",
            "/_Admin/Scripts/components/kbPager.js"
        ])
    })()
</script>
<script src="/_Admin/View/Market/Scripts/Kooboo.Market.js"></script>
<script src="/_Admin/View/Market/Demand/Proposals.js"></script>